package com.fangyi.yunmusic.controller.es;


import com.fangyi.yunmusic.pojo.es.PlaylistDocument;
import com.fangyi.yunmusic.service.es.PlaylistSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PlaylistSearchController {

    @Autowired
    private PlaylistSearchService playlistSearchService;

    @GetMapping("/playlist/search")
    public Object queryPlaylist(Integer pageNum, Integer pageSize, String query) {
//        Page<PlaylistDocument> page = playlistSearchService.queryPlaylist(pageNum, pageSize, query);
//        return page;
        return playlistSearchService.queryPlaylistVO(pageNum, pageSize, query);
    }


}
